package com.example.demo.decorator.version02;

/**
 * @Name : com.example.demo.decorator.version02.Test
 * @Description : 描述
 * Created by cyd on 2021-05-25 09:22:34
 */
public class Test {
    public static void main(String[] args) {
        ConcertPack concertPack = new ConcertPack();
        ComputerPack computerPack = new ComputerPack();
        BookPack bookPack = new BookPack();
        // 开始套娃
        bookPack.setPack(computerPack);
        computerPack.setPack(concertPack);
        bookPack.toPack();
        System.out.println("-----------------");
        CupPack cupPack = new CupPack();
        // 再次套娃
        cupPack.setPack(bookPack);
        cupPack.toPack();
    }
}
